<!DOCTYPE>
<?php
$con =@mysqli_connect("localhost","root","root","educate");
if(!$con){
    exit("<h1>数据库连接失败</h1>");
}

    // print "成功连接到数据库！";
?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>C语言问题求解</title>
    <link type="text/css" rel="stylesheet" href="../css/style.css" />
    <script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../js/menu.js"></script>
    <link rel="stylesheet" href="../../assets/css/vendor/vendor.min.css">
    <link rel="stylesheet" href="../../assets/css/plugins/plugins.min.css">
    <link rel="stylesheet" href="../../assets/css/style.min.css">


</head>

<body>

    <!-- ========================
    Offcanvas Menu Area Start
    ===========================-->

    <!-- ========================
    Offcanvas Menu Area End
    ===========================-->

    <!-- =================
    Header Area Start
    =====================-->
    <div class="header-area header-three">

        <!-- Header Middle Start -->
        <div class="header-middle space-40 sticker" style="padding: 18px;">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-lg-3 col-6">
                        <div class="logo">
                            <a href="../../index.php"><img src="../../assets/images/logo/pos-circle-logo.jpg" alt=""
                                                      class="img-fluid"></a>
                        </div>
                    </div>
                    <div class="col-lg-9 col-6">
                        <div class="header-middle-inner">
                            <!-- Main Menu Start -->
                            <div class="header-menu float-left add-sticky">
                                <div class="sticky-container">
                                    <div class="logo">
                                        <a href="../../index.php"><img src="../../assets/images/logo/pos-circle-logo.jpg" alt=""
                                                                  class="img-fluid"></a>
                                    </div>
                                    <nav class="main-menu">
                                        <ul>
                                        <?php
                                        mysqli_select_db($con,"educate");
                                        $sql = "SELECT * FROM navigation_bar WHERE pid = '0'";
                                        $result = mysqli_query($con,$sql);
                                        while($row = $result->fetch_assoc()) {?>
                                            <li>
                                                <?php
                                                if($row['type'] == 'hyperlink'){?>
                                                    <a href="<?php echo $row['link'];?>"><?php echo $row['name'];?></a>
                                                <?php }
                                                elseif($row['type'] == 'extension'){?>
                                                    <a href="<?php echo $row['link']?>"><?php echo $row['name']?> <i class="fa fa-angle-down"></i></a>
                                                    <div class="mega-menu dropdown">
                                                        <ul class="mega-menu-inner d-flex">
                                                            <?php
                                                            $id = $row['id'];
                                                            $sqll = "SELECT * FROM navigation_bar WHERE pid = '$id'";
                                                            $resultt = mysqli_query($con,$sqll);
                                                            while($roww = $resultt->fetch_assoc()) {?>
                                                                <li>
                                                                    <a href="<?php echo $roww['link'];?>"><?php echo $roww['name']?></a>
                                                                    <ul>
                                                                        <?php
                                                                        $idd = $roww['id'];
                                                                        $sqlll = "SELECT * FROM navigation_bar WHERE pid = '$idd'";
                                                                        $resulttt = mysqli_query($con,$sqlll);
                                                                        while($rowww = $resulttt->fetch_assoc()) {?>
                                                                            <li><a href="<?php echo $rowww['link']?>"><?php echo $rowww['name']?></a></li>
                                                                        <?php }?>
                                                                    </ul>
                                                                </li>
                                                            <?php }?>
                                                        </ul>
                                                    </div>
                                                <?php }?>
                                            </li>
                                        <?php } ?>
                                        </ul>
                                    </nav>

                                </div>
                            </div>
                            <!-- Main Menu End -->

                        </div>
                    </div>

                </div>

            </div>
        </div>
        <!-- Header Middle End -->
        <div class="breadcrumbs_area">
            <div class="container">
                <div class="row">
                    <div class="col-12">
                        <div class="breadcrumb_content">
                            <ul>
                                <li>
                                    <h1><a href="../../index.php">首页</a></h1>
                                </li>
                                <li>教学资源/C语言</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Header Bottom Start -->

        <!-- Header Bottom End  -->
    </div>
    <!-- =================
    Header Area  End
    =====================-->

    <div id="content">
        <div class="left_menu">
            <ul id="nav_dot">
                <?php
                mysqli_select_db($con,"cresorce");
                $sql = "SELECT * FROM sidelist WHERE pid = '0'";
                $result = mysqli_query($con,$sql);
                while($row = $result->fetch_assoc()) {?>
                    <li>
                        <h4 class="<?php echo $row['class']?>"><span></span><?php echo $row['name']?></h4>
                        <div class="list-item none">
                        <?php
                        $id = $row['id'];
                        $sqll = "SELECT * FROM sidelist WHERE pid = '$id'";

                        $resultt = mysqli_query($con,$sqll);
                        while($roww = $resultt->fetch_assoc()){?>
                            <?php
                            $_SESSION['id'] = $roww['id'];
                            $idd = $roww['id'];
                            if ($roww['id']=='86'){?>
                                <a href="<?php echo $roww['link'];?>" target="menuFrame"><?php echo $roww['name']  ?></a>)
                            <?php }
                            else {?>
                                <a href="<?php echo "template/00.php?idd=$idd";?>" target="menuFrame"><?php echo $roww['name']?></a>

                            <?php } ?>
                        <?php }?>
                        </div>
                    </li>
                <?php } ?>
                <?php $con->close()?>
            </ul>
        </div>

        <div id="main" class="m-right">
            <iframe id="menuFrame" name="menuFrame" src="template/notice.php" style="overflow:visible;"
                    scrolling="yes" frameborder="no" width="100%" height="100%"  webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
        </div>

    </div>

    <footer class="mt-10" style="position: absolute;top: 460px;; left:0px;width:100%">
        <!-- Footer Bottom Start -->
        <div class="footer-bottom" style="position: absolute;top:200px;width: 100%">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-lg-5 col-md-12 col-12">
                        <div class="footer-bottom-content">
                            <div class="footer-copyright">

                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7 col-md-12 col-12">
                        <div class="payment">
                            <a href="#">
                                <p>Copyright &copy; 2022.计算机应用技术系 All rights reserved.</p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Bottom End -->
    </footer>
    <script src="../../assets/js/vendor/vendor.min.js"></script>
    <script src="../../assets/js/plugins/plugins.min.js"></script>

    <!-- Main JS -->
    <script src="../../assets/js/main.js"></script>


    <script>navList(12);</script>
</body>
</html>
